﻿using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

namespace Yoozoo.Gameplay.CityEditor
{
    [CustomEditor(typeof(CityRoomDataEditor))]
    public class RoomDataExportEditor : UnityEditor.Editor
    {
        private CityRoomDataEditor _cityRoomDataEditor;
        private void OnEnable()
        {
            _cityRoomDataEditor = target as CityRoomDataEditor;
        }
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            serializedObject.Update();
            if (GUILayout.Button("导出房间数据",GUILayout.Height(30)))
            { 
                var configPath = $"{Application.dataPath}/../Lua/modules/city/config/CityRoomDataConfig.lua";
                //_eventEditorManager.SetEditing(false);
                _cityRoomDataEditor.Save(configPath);
            }
        }
    }
}

